package com.sxbbc.common.basics.files;

import java.io.Serializable;

public class RestUploadFileInfo implements Serializable {
	private static final long serialVersionUID = -3535922935017949524L;
	private boolean status;
	private String desc;
	private String data;

	private static RestUploadFileInfo restUploadFileInfo = null;

	public static RestUploadFileInfo getInstance() {
		if (restUploadFileInfo == null) {
			synchronized (RestUploadFileInfo.class) {
				if (restUploadFileInfo == null) {
					restUploadFileInfo = new RestUploadFileInfo();
				}
			}
		}
		return restUploadFileInfo;
	}

	public boolean isStatus() {
		return this.status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	public String getDesc() {
		return this.desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

	public RestUploadFileInfo getFail(String msg) {
		RestUploadFileInfo fileInfo=RestUploadFileInfo.getInstance();
		fileInfo.setStatus(false);
		fileInfo.setDesc(msg);
		return fileInfo;
	}
	
	public RestUploadFileInfo getSuccess(String msg,String url){
		RestUploadFileInfo fileInfo=RestUploadFileInfo.getInstance();
		fileInfo.setStatus(true);
		fileInfo.setDesc(desc);
		fileInfo.setData(url);
		return fileInfo;
	}
	
	public RestUploadFileInfo getSuccess(String url){
		RestUploadFileInfo fileInfo=RestUploadFileInfo.getInstance();
		fileInfo.setStatus(true);
		fileInfo.setDesc("成功");
		fileInfo.setData(url);
		return fileInfo;
	}
}